This application is based upon and claims the benefit of Japanese Patent Application Nos. 2000-324553 filed on Oct. 24, 2000 and No. 2001-310309 filed on Oct. 5, 2001, the entire disclosures of which are incorporated herein by reference.
The present invention relates to an image processing technique in computer graphics and particularly to a method for easily expressing irregularities on a surface of an object to be subjected to image processing.
In a system for computer graphics, there is an image processing system including (i) an image generator that performs processing such as coordinate conversion including rotation, movement, and scaling, and perspective transformation, shading, and hidden-line/surface removal with respect to an object, and (ii) a graphic processor that draws an image in frame memory.
The image generator generates a graphic instruction (a display list) for drawing a basic graphics (polygon) such as a triangle, rectangle as a result of the above processing in frame memory, which is graphic memory, and sends it to the graphic processor.
The graphic processor draws the image on the frame memory in accordance with the display list sent from the image generator. The graphic result in the frame memory is converted to a video signal and is displayed on a display, making it possible to visually identify the image.
The application field of such an image processing system has grown exponentially in recent years, and this is widely used in not only the industrial field such as CAD (Computer Aided Design) but also in the entertainment field such as in movies, television, and videogames. Particularly, in the entertainment field, the ability to express as real an image as possible at high speed has been desirable in addition to simply displaying the object on the display.
As a method for improving expressive power of computer graphics to obtain a real image, texture mapping is used. Texture mapping adheres (maps) a two-dimensional image (picture) prepared separately from the mapping mage, namely a texture onto the polygon, which constitutes an object and which is the basic graphics.
However, the image obtained by texture mapping can greatly improve the expressive power relating to the color but has difficulty in expressing irregularities on the surface of object. This causes a problem in which the surface of object is so smooth that a realistic expression cannot be obtained.
If modeling is performed that includes the irregularities on the surface of object in detail, an extremely realistic expression may be possible, but the amount of data increases and high-speed image processing cannot be carried out. In addition, it takes a lot of time to carry out modeling itself. Accordingly, this is not a practical method.
Conventionally, bump mapping is used to which the texture mapping is applied as a method for easily expressing the irregularities on the surface of object. The bump mapping can be explained as follows: the surface of an object is divided into a plurality of divided surfaces. Then, a plurality of normal vectors in which their directions are fixed independently are mapped onto the respective divided surfaces. A shading process is carried out based on these normal vectors so as to obtain corresponding luminance values. Then, the divided surfaces are shaded according to the obtained luminance values so as to express unevenness or irregularities on the surface of the object in a pseudo manner. This makes it possible to implement an image resembling the object precisely modeled with a small amount of data.
On the other hand, there is a color lookup table (hereinafter referred to as xe2x80x9cCLUTxe2x80x9d), which is often used when conversion of color is needed in computer graphics. The CLUT is used as a color conversion table at a color conversion time in computer graphics. The CLUT provides a realistic image with respect to the color. However, the realistic expression is determined depending on the modeling, similar to the texture mapping.
Bump mapping is one of the useful methods currently used to easily express the irregularities on the surface of an object.
However, since the normal vectors mapped onto the divided surfaces are different vectors, respectively, a shading process must be performed based on all normal vectors. Thus, for example, if each divided surface is formed to have the size equivalent to the size of one pixel and the normal vector is mapped onto each divided surface in order to precisely express the irregularities on the surface of object, it takes much time to carry out the shading process, so that high-speed processing cannot be implemented.
It is an object of the present invention is to provide a technique for allowing image processing such as bump mapping to be carried out at high speed regardless of fineness of an image.
According to one aspect of the present invention, there is provided an image processing method comprising the steps of: dividing a surface of an object of image data into a plurality of areas; generating a first normal vector for each of the plurality of areas; determining second normal vectors each having identification data, wherein the number of the second normal vectors is smaller than the number of the first normal vectors; classifying the first normal vectors into the second normal vectors; assigning each of the second normal vectors to at least one of the plurality of areas where the correspondingly classified first normal vector has been generated; and shading each of the plurality of areas based on the identification data of the corresponding second normal vector.
The identification data may include a luminance value.
The surface of the object may consist of at least one polygon.
Each of the plurality of areas may consist of one pixel.
The first normal vectors may be classified into the second normal vectors according to directions of the first normal vectors.
The second normal vectors may be generated based on the first normal vectors.
The step of determining the second normal vectors may comprise the steps of: classifying the first normal vectors into a plurality of groups according to directions of the first normal vectors, wherein the number of the plurality of groups is equal to the number of the second normal vectors; averaging the classified first normal vectors in each group; and generating each of the second normal vectors corresponding to one of the averaged first normal vectors.
According to another aspect of the present invention, there is provided an image processing apparatus comprising: first means for dividing a surface of an object of image data into a plurality of areas, and generating a first normal vector for each of the plurality of areas; second means for determining second normal vectors each having identification data, wherein the number of the second normal vectors is smaller than the number of the first normal vectors; third means for classifying the first normal vectors into the second normal vectors, and assigning each of the second normal vectors to at least one of the plurality of areas where the correspondingly classified first normal vector has been generated; and fourth means for shading each of the plurality of areas based on the identification data of the corresponding second normal vector.
The apparatus may further comprise: fifth means for adding a luminance value to each of the identification data; and sixth means for generating table data in which each of the luminance values and the corresponding identification data are linked with each other.
The identification data may include a luminance value.
The surface of the object may consist of at least one polygon.
Each of the plurality of areas may consist of one pixel.
The first normal vectors may be classified into the second normal vectors according to directions of the first normal vectors.
The second normal vectors may be generated based on the first normal vectors.
The second means may comprise: means for classifying the first normal vectors into a plurality of groups according to directions of the first normal vectors, wherein the number of the plurality of groups is equal to the number of the second normal vectors; means for averaging the classified first normal vectors in each group; and means for generating each of the second normal vectors corresponding to one of the averaged first normal vectors.
According to another aspect of the present invention, there is provided a semiconductor device comprising: first means for dividing a surface of an object of image data into a plurality of areas, and generating a first normal vector for each of the plurality of areas; second means for determining second normal vectors each having identification data, wherein the number of the second normal vectors is smaller than the number of the first normal vectors; third means for classifying the first normal vectors into the second normal vectors, and assigning each of the second normal vectors to at least one of the plurality of areas where the correspondingly classified first normal vector has been generated; and fourth means for shading each of the plurality of areas based on the identification data of the corresponding second normal vector.
According to another aspect of the present invention, there is provided a computer program for causing a computer to execute the steps of: dividing a surface of an object of image data into a plurality of areas; generating a first normal vector for each of the plurality of areas; determining second normal vectors each having identification data, wherein the number of the second normal vectors is smaller than the number of the first normal vectors; classifying the first normal vectors into the second normal vectors; assigning each of the second normal vectors to at least one of the plurality of areas where the correspondingly classified first normal vector has been generated; and shading each of the plurality of areas based on the identification data of the corresponding second normal vector.